<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<script language="Javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.tablesorter.js"></script> 

<script type="text/javascript" src="js/paging.js"></script>
<script language="JavaScript">
$(document).ready(function()
		{
	
	
	$("#allsts").change(function() {
		var isChecked = $('.selsts').attr('checked')?true:false;
		if(isChecked==false){
			$(".selsts").attr('checked', true);
		}
		else{
			$(".selsts").attr('checked', false);
		}
		
		});	    
	
	
	$('#search').keyup(function()
		    {
		        searchTable($(this).val());
		    });
		    
		    $("#example").tablesorter({ 
		       
		        headers: { 
		           
		             0: { 
		               
		                sorter: false 
		            },
		            
		            7: { 
		                
		                sorter: false 
		            },
		            8: { 
		                 
		                sorter: false 
		            }
		        } 
		    }); 
		    
		    
		   
		    $('#btnHide').click(function() {
                
                $('td:nth-child(2),th:nth-child(2)').hide();
            });
		    //$('td:nth-child(2),th:nth-child(2)').hide(); 
		    });
		 
		function searchTable(inputVal)
		{
		    var table = $('#example');
		    table.find('tr').each(function(index, row)
		    {
		        var allCells = $(row).find('td');
		        if(allCells.length > 0)
		        {
		            var found = false;
		            allCells.each(function(index, td)
		            {
		                var regExp = new RegExp(inputVal, 'i');
		                if(regExp.test($(td).text()))
		                {
		                    found = true;
		                    return false;
		                }
		            });
		            if(found == true)$(row).show();else $(row).hide();
		        }
		    });
		}
		



</script>

<link rel="stylesheet" type="text/css" href="css/style.css">
<style type="text/css">
div#navigation1
{
cursor:pointer;
}



</style>
</head>


<body>

	<s:actionerror />
	<div id="full_table">
	<div id="choose_which_columns_to_show"></div>
	<div id="actual_table">
	<div align="right">Search Entries:<input type="text" id="search"/></div>
	
	<form id="form">
		<table id="example" class="tablesorter" width="100%">
			<thead>
				<tr bgcolor="yellow">
				<th><input type="checkbox" id="allsts"/></th>
					<th>Student ID</th>
					<th>Roll Number</th>
					<th>Name</th>
					<th>Email-Id</th>
					<th>Mobile Number</th>
					<th>Address</th>
					<th></th>
					<th></th>
				</tr>
			</thead>
			<tbody>
				<s:iterator value="list">
					<tr>
						<td><input type="checkbox" class="selsts"/></td>
						<td><s:property value="student_id" /></td>
						<td><s:property value="roll_number" /></td>
						<td><s:property value="student_name" /></td>
						<td><s:property value="email_id" /></td>
						<td><s:property value="mobile_number" /></td>
						<td><s:property value="address_line_1" /></td>
						<td><a href="admin/EditStudent.jsp?student_id=<s:property value="student_id"/>">Edit</a></td>
						<td><a href="delete_student_details.action?student_id=<s:property value="student_id"/>">Delete</a></td>
					</tr>
					
				</s:iterator>
			
			</tbody>
		</table>
		</form>

</div>
</body>
</html>